package com.xxxx.yeb.mapper;

import com.xxxx.yeb.pojo.Department;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zhoubin
 * @since 2020-07-17
 */
public interface DepartmentMapper extends BaseMapper<Department> {

    //查询所有部门信息
    List<Department> getDePartmentByid(Integer parentId);

    //添加
    Integer addDepartment(Department dep);
    //查询父部门信息
    Department queryDep(Integer id);
    //查询子部门信息
    String querySubDep(String name);
    //更新子部门路劲
    Integer updateSubDep1(String depPath,String name);
    //更新父部门isParent
    void updateDep(int isParent, Integer id);


    //查询要删除部门有没有子部门
    Department queryDepartment(Integer parentId);
    //如果没有子部门更新要删除部门的enabled
    Integer deleteDepartment(Integer id);
    //查询要删除部门的父部门还有没有子部门
    Department queryFatherDepartment(Integer parentId);
    //如果父部门没有子部门且isParent为1，则更新isParent
    void updateDepartment(Integer id);
    //查询子部门的parentId
    Department querySubDepartment(Integer id);

}
